Skip to content

Guard RedactUrlQueryParamsFilter against None args - #947

Open
jonathanberthias wants to merge 1 commit into
databricks:mainfrom
jonathanberthias:fix-redact-filter-none-args
Open

Guard RedactUrlQueryParamsFilter against None args#947
jonathanberthias wants to merge 1 commit into
databricks:mainfrom
jonathanberthias:fix-redact-filter-none-args

Conversation

@jonathanberthias

Copy link
Copy Markdown

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Other

Description

urllib3.connectionpool records can arrive with record.args set to None when another logging filter (e.g. MLflow's SensitiveQueryParamFilter) redacts the message and nulls args before this filter runs. Iterating None raised TypeError. Guard the tuple branch with an explicit None check.

Also fix a typo in the dict-args branch: record.arg[k] should be record.args[k], which would raise AttributeError whenever a record carried dict args.

How is this tested?

  • Unit tests
  • E2E Tests
  • Manually
  • N/A

Related Tickets & Documents

Fixes #946

urllib3.connectionpool records can arrive with record.args set to None when another logging filter (e.g. MLflow's SensitiveQueryParamFilter) redacts the message and nulls args before this filter runs. Iterating None raised TypeError. Guard the tuple branch with an explicit None check.

Also fix a latent typo in the dict-args branch: record.arg[k] should be record.args[k], which would raise AttributeError whenever a record carried dict args.

Fixes databricks#946

Signed-off-by: Jonathan Berthias <jvberthias@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RedactUrlQueryParamsFilter crashes with TypeError: NoneType is not iterable when MLflow's urllib3 filter runs first

1 participant